home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
stats
/
caf20.exe
/
CAF.DOC
next >
Wrap
Text File
|
1992-01-01
|
29KB
|
672 lines
CAF 2.0
Resident Floating Point Scientific Calculator
by
Bob Eyer
[73230,2620]
Jan 1, 1991
┌────────────────────────────────────────────────────────────┐
│ WARNING: THIS SOFTWARE MAY NOT WORK PROPERLY WITH CERTAIN │
│ APPLICATIONS. SEE CAUTION BELOW. │
└────────────────────────────────────────────────────────────┘
** SHAREWARE NOTICE **
This program is shareware: if you think it's a worthy addition to
your personal software, you should register with the author.
Register this one, and you get a disk full of some of the best
utilities in the business FOR FREE!!
The registered version of CAF has hour/degree-minute-second
conversions, factorials, extra save registers, and more!
Simply make out a money order in the amount of $20 US to Bob
Eyer and send with your return address to:
Bob Eyer
1100 Bloor Street West
Suite 16
Toronto, Canada M6H 1M8
Please mention in your accompanying note whether you wish 5.25" or
3.5" diskette format, and state the name in which you wish
registration-only utilities to be registered. [Certain of the
most important items have never been posted and are distributed
only through the registration.]
Enquiries may be placed by writing directly to the author at
Compuserve userid [73230,2620].
Warranty and Disclaimer:
-----------------------
The author, Bob Eyer, guarantees the physical integrity of the
diskette covering the points above, and will replace free of
charge, if it is received defective. However, in no case will the
author be responsible for any damages due to loss of data or any
other reason. In no event does the author's liability for any
damages exceed the price paid for the buyer's order of this
software, regardless of the form of the claim. The person using
the software bears all risk as to the quality and performance of
the software.
See Program Listing at end of documentation for the primary
benefits of registering.
Help screen
-----------
Syntax: CAF [/U] /U = unload from memory
Hotkey: Rightshift-/
Binary operations: + - * / ^
Unary operations: SQ SQRT EXP LOG SIN ASN COS ACS TAN ATN
SINH COSH TANH
Constant operations: E PI A B C
Special Accumulator: ADD [E to exit accumulator]
Modes: x PLACES COLOR y RAD DEG TWO NAP TEN N D
Review: ST
See the note about Errors below.
INTRODUCTORY NOTE: CAF is a floating point companion alternative
to CA (see program listing at end of this doc file), which is
restricted to four function fixed point arithmetic. CAF supports
a minimum of 18 functions. Registered versions of CA use less
than 10K of memory; CAF uses about 26K. This is comparable to
some of the simpler floating point calculators, such as FFC, but,
unlike these (which are usually restricted to the standard four
arithmetic functions), CAF offers far more functionality.
CAF is not a general formula evaluator. If you need to do many
different kinds of calculations on the same text in one shot, it
may be more appropriate to use Lotus 1-2-3 or similar, print
results as a file, edit, and then insert into your text. CAF,
however, does provide a simple means of re-using input data for
subsequent calculations (see section below about Automatic
Store/Recall and also the discussion about Constant Operations).
Also, CAF provides a method of adding many numbers before
injecting the sum to text (See Special Accumulator section below).
CAF's floating point emulator will take advantage of the
coprocessor, if one is installed. This advantage is noticeable
primarily on XT's and slow AT's, and primarily with regard to the
transcendental functions. Except for SQ, all Unary operations and
the power function are directly or indirectly based on infinite
series and/or the use of Newton's Method. The accuracy of this
range of functions is about 12 significant figures, rather than
the usual 15 for ordinary arithmetic.
CAF's real number range, apart from sign, is roughly between
1e-294 and 1.7e+308. This is much larger than is possible in the
companion program CA, and is also larger than the usual range for
many scientific calculators.
IMPORTANT: This program does not provide a menu or picture of a
calculator - so as to avoid obscuring portions of the underlying
editing application, and to avoid requiring the user to employ
only 25 x 80 screens (some TSR calculators require this, to make
use of Line 25 for calculator monitoring). CAF responds equally
well in 50 x 80 or 44 x 132 video environments; generally, it is
indifferent to the manner in which the video raster is defined.
CAF is designed to respond just to the hotkey, which provides
merely a 'calculation window', in which the user enters his
calculations or mode changes. Hitting ENTER after supplying a
calculation or mode change to the window, simply executes the job
and returns to the application. Where a result is generated, it
is pasted directly to the underlying application where the cursor
was last located.
In examples seen below, EACH calculation or mode change is
preceded by invoking the hotkey. This, however, does not apply to
the Special Accumulator (see below).
CAF is also designed to return the cursor to the initial position
in the same window, to permit making mode adjustments without line
skipping. Once a task is completed, you may exit the window
merely by hitting ENTER one additional time or by using the
spacebar to delete the window. The old window always disappears
in an editing environment after the result is injected to the
text, but mode change information will, in general, remain.
Modes/review
------------
CAF provides five groups of mode selections - number of decimal
places to which to round results, colour of calculation window,
whether to use Radian or Degree measure, what base to use for the
EXP and LOG operations, and whether to echo the result to display
or paste to text.
The current mode situation may be viewed simply by entering ST in
the calculation window (ST is short for 'status').
Mode changes are entered directly in the calculation window and
the new mode specs are resummarised in the calculation window,
just as though ST had been issued.
x PLACES:
Entry of '5 places' in the calculation window will cause CAF to
operate so as to round all results to five decimal places. Entry
of 0 places means that no formatting will occur; that is, that
results will appear with the maximum precision stuffable into the
keyboard buffer at one pass. The default value for Places is 0.
Exception: Where the resulting number contains exponential
('scientific') notation, CAF automatically rounds the mantissa
to 7 decimal places, unless PLACES was previously set to a
different number. The maximum number of formatted decimal
places is 7, so a different number would have to be less than
7. The reason why CAF does this is to prevent overflowing the
capacity of the keyboard buffer, the standard value of which is
15 characters. Exceeding the capacity of the keyboard buffer
will always cause a system crash, requiring reboot. However,
this should never happen, unless the user's computer has a
non-standard keyboard buffer. See CAUTION below about keyboard
buffer changing programs. Please inform me of the brand and
type of computer as well as other resident TSR's in your system,
if you wish to report problems of this type.
COLOR y:
Entry of 'COLOR 30' will cause the calculation window to have a
bright yellow foreground and a blue background. For colour
details see below. The default colour scheme is black on white
(112). Color 0 automatically converts to 112, so as to avoid
black on black.
RAD/DEG:
Entry of RAD in the window causes CAF to assume all angles entered
as arguments in trig functions are in radian measure. Entry of
DEG puts CAF into Degree mode. The default is Degree mode.
TWO/NAP/TEN:
CAF supports three bases for use with the LOG or EXP functions.
TWO means use Base 2; NAP is short for the Napierian base
(2.718 ...) and means Base e; and TEN means use Base 10. The
default is Base e.
N/D:
N means normal, and D means display. N is the default. Normal
mode injects results to the underlying application; display mode
echoes results to the screen without pasting to the application.
Display mode may be useful where you may wish to see every digit
of some kinds of numbers which occupy more than 15 characters.
Formatting to a given number of decimal places does not apply to
Display mode. (See 'Exception' above in the discussion of
PLACES).
Constant operations
-------------------
CAF supports pasting two constants direct to text, E and PI.
For example, after invoking the hotkey, we simply enter
e [= 2.7182818284590
(the use of the left bracket here merely signifies that the result
appears at the underlying application, not at TSR level)
In addition, the user may simply enter A, B, or C to examine the
last value stored in CAF's "store/recall" facilities (see below).
Binary operations
-----------------
CAF supports five two-variable ('binary') operations: + - * / ^,
or add, subtract, multiply, divide, and raise to a power,
respectively. For example,
1991-1917 [= 74
7e-6+3e-4 [= 0.000307
3.33e+1+4.56e-3 [= 33.30456
When entering exponentially formatted numbers one must specify a
sign (+ or -) immediately after the 'e' symbol.
Additional examples:
35/34 [= 1.0294117647058
35*34 [= 1190
35^34 [= 3.1500214e+52
Unary operations
----------------
CAF also supports 10 unary transcendental functions, grouped by
inverses, as well as three hyperbolic functions. Here, a blank
must separate the name of the operation and the number which the
operation takes as its argument. Examples,
SIN 45 [= 0.7071067811865
COS 1 [= 0.9998476951563
LOG 2 [= 0.6931471805599
EXP 1 [= 2.7182818284590
SQRT 2 [= 1.4142135623731
If you wish to use Base 10 logarithms, just enter TEN in the
window, and then
LOG 2 [= 0.3010299956639
Note: the EXP function is in fact an antilog function, since it is
subject to the same range of base changes as is the LOG function.
This may be inconvenient to some users who assume that the
exponential function must always have base e, but implementing a
separate antilog function seemed, in the circumstances, merely to
be useless duplication of what is, essentially, a quite flexible
function.
The internal setup for the hyperbolic functions is the same as for
the trig functions. If you select DEGree mode, CAF will convert
your degree measure into the radian equivalent before calculating
the function. If you select RADian mode, CAF will do no such
conversion, but will inject your argument directly to the
function.
Automatic store/recall
----------------------
If you are doing several calculations which involve use of the
same term, you may reduce typing further by using variables.
Calculation window variables are A, B, and C. The first time
you execute a calculation with numbers, the first number is
always stored into A, the second number into B, and the result
into C. These values can be re-used, simply by employing these
variables in subsequent calculations [except, of course, for the
fact that, as each new calculation is done, the value of C will
be updated with the new result].
Example (after entering '3 PLACES' in the window):
Suppose we wish to perform the following calculations -
34.21102 x 435, and
34.21102 / 355.5
Here, each calculation uses the same initial term. We proceed
as follows, each time by hitting Rightshift-slash, and entering
the calculation shown:
34.21102 * 435 [= 1.488e+4
a/355.5 [= 9.623e-2
The second calculation above could be repeated merely by entering
a/b
The user may also proceed to obtain results for the other three
operations, using the same numbers, as follows:
a*b [= 12162.018
a+b [= 389.711
a-b [= -321.289
The output C-variable can also be used in calculations. For
example, we may first calculate with no scientific notation
2/3 [= 0.667 ]
Here, A = 2, B = 3, and C is the result in brackets. Now, if we
multiply the result C by 3, we should get back the numerator A:
C * 3 [= 2.000
This example illustrates the fact that CAF, like handheld
calculators with the store/recall function, stores results in a
separate register before rounding. It is this separate register
that is used for input, when the user employs C in a
calculation. [otherwise, the user might get back 2.001].
This type of 'result protection' on use of a previous result is
not, however, found in most TSR calculators.
All these remarks apply also to CAF's trig functions. For
example (using 5 decimal places),
SIN 89 [= 0.99985
We may now get back the value of the argument, simply by
performing the inverse (ARCSINE or ASN) on the result:
ASN C [= 89.00000
The same principle also works with squares and squareroots, as
well as logs and exponentials. For example,
LOG 2 [= 0.69315
but the argument '2' may be had by performing the inverse on the
result:
EXP C [= 2.00000
Special Accumulator
-------------------
Entry of the keyword ADD in the calculation window, will transfer
control to a special area of CAF, which displays the following
type of prompt:
E>
The purpose of the 'E' is to remind you how to exit and inject
your result to the underlying application. To exit and inject,
just enter E. [If, however, you had placed CAF into D, or
Display, mode, the result will merely be echoed to CAF's window.
See discussion above about Modes.]
Numbers entered at this prompt are totalled, each total being
echoed in the right half of the display. Entry of E finishes the
operation, wipes the special window from the screen (if you're in
an editing environment), and injects the result to the underlying
application.
This accumulator function, in future versions, may become the
basis of providing new functions, such as the Standard Deviation,
making possible addition of statistics functions.
Don't forget: E means exit!
Prompt Colour
-------------
As stated above, to change the colour of the calculation window,
simply enter
COLOR x
in the window, where x is a COLOR number. The default is 112,
which describes black foreground on a white background. 0 is
impossible (black on black), and so CAF converts that number to
112 automatically. Foreground and Background colours may be
determined by using the following table:
Back Fore Bright Fore
---- ---- -----------
Black 0 0 8
Blue 16 1 9
Green 32 2 10
Cyan 48 3 11
Red 64 4 12
Magenta 80 5 13
Brown 96 6 14
White 112 7 15
The correct COLOR number is found merely by adding the Foreground
number to the Background number desired. For example, Bright
Green on Blue background is 10 + 16 = 26.
Avoid setting COLOR above 127. Values above that limit will
produce blinking displays.
In my estimation the COLORs best for the eye are 10, 11, 14, 15,
26, 27, 30, 31, 74, 75, 78, 79 and 112. But you may have other
ideas. Example,
COLOR 75
sets the window to Bright Cyan on a Red background.
Errors
------
CAF supports four error reports -
xyz: illegal (see docs) - This message occurs where your entered
instruction, 'xyz', is not recognised by
CAF. For example, 'TAN89' is illegal;
should be 'TAN 89'.
Read examples in documentation above to
be sure you understand how to enter
expressions.
Zero divide error - Attempt to divide by zero. This can be
an explicit mistake, like '5 / 0', or it
may be an attempt to calculate the value
of a unary function which divides two
other functions to obtain its result.
For example, the TAN, or Tangent of an
angle, is really the ratio of the Sine
and the Cosine of that angle; but the
Cosine of 90 degrees is zero, so trying
to find the Tangent of 90 will generate
this error.
Negative base error - You tried raising a negative number to a
power (cannot be done on real numbers).
Negative argument error - You tried taking the LOG of a negative
number (cannot be done on real numbers).
CAUTION
-------
Certain types of editors will not work consistently with CAF - in
particular, editors which simulate the Macintosh console
environment, such as the Microsoft DOS 5.0 Editor. Like Microsoft
Windows, these environments do certain tricks with video display -
and, so I understand, certain tricks to redefine one or more
interrupt functions - which lead to machine hangs when CAF and
other similar TSR's are run concurrently with them. (The problem
here is not unique to CAF, as collateral testing of other TSR
calculators has shown). If you're serious about computing, don't
use graphics user interfaces (GUI's)!
Further, like all memory resident programs, CAF is vulnerable to
compatibility problems which may arise from its use with other
TSR's. If you find you must reboot, try removing other memory
resident programs from your AUTOEXEC.BAT file, or try changing the
sequence in which they are loaded until you find the best
combination.
However, tests have shown that CAF is much less vulnerable to
interrupt collisions and other compatibility problems than other
resident floating point calculators.
One category of TSR which is almost guaranteed to cause trouble
for CAF (and for any program which stuffs keystrokes into the
keyboard buffer) are programs like 128KEY.COM, which lengthen or
change the effective size of the keyboard buffer. Don't use such
programs with CAF.
CAF is primarily intended to work with editors and wordprocessors,
and has been tested on Wordperfect 5.0, Galaxy 2.42, Captain
Blackbeard 1.13, SLED 1.1, QEDIT 2.08, pEDIT 2.10, and a number of
other editors/wordprocessors, with no confirmed problem or
abnormality.
CAF is recommended for use as the last memory resident program
loaded, so as to permit the use of the /U commandline option to
unload it from memory, and only in standard text-editing or
wordprocessing applications. Unless you have found that CAF works
with your non-standard application, it is recommended that you
take the precaution of unloading CAF before you invoke such an
application.
DESCRIPTION OF PROGRAMS YOU WILL RECEIVE FREE WITH YOUR REGISTRATION
********************************************************
Many of the programs in the following list have not been publicly
posted, and those which have been posted previously are unlikely
to be posted in new updates, except in rare cases.
Certain programs are registered-only, which means that the user
must not post copies on bulletin boards.
Nearly all file-processing programs take full advantage of
wildcard logic, including DOS shortcuts, keeping keystrokes to
absolute minimum.
Total size in compressed form for all of below: about 320K.
MG
--
Moving average ASCII graphing program. Especially designed for
obtaining graphic updates on stock-market activity in practical
trading environments, in which it is essential that the user get a
quick graph immediately, with points of the graph directly
associated with the numerical and other text information which
these points represent (a feat impractical in Lotus graphics).
Designed to be used with SETV below.
SPC
---
Multidrive columnar drive report, with fairly complete description
of your machine including communications, important chips,
printer, BIOS, memory, processor and coprocessor speed,
multitasking, networking, and so on, all in one single snapshot.
SETV
----
Sets seven VGA text video modes. Enables Multisync or VGA user to
make use of seven major video text modes at DOS level, including
132 column modes.
AL
--
Best and most flexible TSR alarm program with clock option. Has
time-locking and a full range of options. 7K of memory.
CA
--
Four-function TSR calculator with formatted displays and
scientific notation for direct paste to text. About 10K of
memory.
CAF
---
TSR floating point calculator with formatted displays and direct
paste to text. 18 functions, and an accumulation area. Five
types of modes. Number formatting. CAF is the most sophisticated
calculator in the business, for its size. 25K of memory. No need
to swap to disk or EMS.
PAUZ
----
Replacement for DOS PAUSE, allows specification of seconds to wait
or target [<=] time, as well as what key to use for pause
interruption. User triggering of error levels 1 to 9.
MV
--
Fast file mover. Preserves date/time/attribute stamp for all
moves. Allows moving Read Only and Hidden files, source files
opened in SHAREd mode for network users. Wildcards. None
faster or safer.
SPLT
----
ASCII file splitter which, for the first time, offers the ability
to prevent the split from resulting in split messages or other
defined text blocks. Works with DIV and REV, below.
OTL
---
Makes it possible to apply any set of operations, say, as
specified in a batch file, to every file in an ASCII list, without
having to specify the path information for each file. For Sysops.
KALL
----
For users of DOS 3.0-3.2 who would like batch file control like
that offered in the more advanced DOS versions. Allows
redirection of batch file output, unlike DOS 4/5 CALL.
SS
--
Secure shell, protects your system from keyboard redefinition
resulting from ANSI codes read in remote message areas. Maintains
default DOS colour scheme, but requires use of NANSI.SYS.
DIV
---
Generalisation of FGREP-type programs to include blocks of text.
A single string defines a block in most kinds of blockable text.
DIV handles almost any kind. Returns blocks containing one or
more of up to 64 different strings from large ASCII files. Useful
in extracting messages or extended file descriptions containing a
range of strings without manual cut and paste. Can prepare a file
containing every block EXCEPT the ones selection, and
simultaneously. See REV in short list below.
COMB
----
Sorts and combines wildcard text files in specified order into
first file found in that order. Primarily for eliminating the
tedium and error involved in accumulating messages into one file
for easy reference.
ADD
---
Adds very lengthy columns of numbers found in ASCII text, such as
byte counts in BBS listings. (Capable of handling the addition of
up to 1 billion numbers in one pass).
CITM
----
Counts similar items in formatted ASCII lists, where the
similarity is based on a fixed string field found at one position
in each line of text, and all lines have been previously sorted,
based on the contents of that string field. Perfect as a
companion utility for Baker's QSORT.
FVER
----
Compares a file list, like a BBS listing, to the actual files
found anywhere in the BBS's download path. Operates in FAST or
SLOW mode, depending on your safety requirements. Can be operated
remotely through a door.
MVA
---
Moves files, even if set to read only status, from anywhere in a
specified download path to a given location. Operates directly on
ASCII lists, like directories or BBS listings. Can be operated
remotely through a door.
RNF
---
Minimises keystrokes and keystroke error on renaming files with
date or time info or special flags.
plus:
----
ELIM - Advanced replacement for DEL.
LCNT - Very fast linecounter; formatted output.
ESRT - Element sorter. User specified delimiter.
TYME - Program execution timer.
CHG - Attribute file/directory/date/time file changer/reader.
CBRO - Compuserve Browse converter. Old/new formats.
REV - Reverses order of blocks of text (messages, etc).
DTR - Toggles modem DTR line.
RTS - Toggles RTS line.
ENV - Environment statistics
CFIX - Fix cursor to normal, block or off.
EL - Converts number to error level, for batch files.
WD - Gives wildcard support to any program.
SWP - Fast single-level sweep program.
TSTF - Floppy disk status tester.
----------------------
End of documentation